home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / xcmdmscl.sit / XCMD Miscellany / card_2912.txt < prev    next >
Text File  |  1989-02-11  |  5KB  |  193 lines

  1. -- card: 2912 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2589
  5. -- name: Cursor Demo
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   SetCursor mouse
  9. end closeCard
  10.  
  11. on arrowKey arb
  12.   visual effect iris close slow
  13.   go card 1
  14. end arrowKey
  15.  
  16.  
  17. -- part 1 (button)
  18. -- low flags: 00
  19. -- high flags: 8003
  20. -- rect: left=4 top=41 right=63 bottom=104
  21. -- title width / last selected line: 0
  22. -- icon id / first selected line: 0 / 0
  23. -- text alignment: 1
  24. -- font id: 0
  25. -- text size: 12
  26. -- style flags: 0
  27. -- line height: 16
  28. -- part name: Demo 1
  29. ----- HyperTalk script -----
  30. on mouseUp
  31.   setCursor loc of button "Demo 2"
  32. end mouseUp
  33.  
  34.  
  35. -- part 2 (button)
  36. -- low flags: 00
  37. -- high flags: 8003
  38. -- rect: left=4 top=98 right=120 bottom=104
  39. -- title width / last selected line: 0
  40. -- icon id / first selected line: 0 / 0
  41. -- text alignment: 1
  42. -- font id: 0
  43. -- text size: 12
  44. -- style flags: 0
  45. -- line height: 16
  46. -- part name: Demo 2
  47. ----- HyperTalk script -----
  48. on mouseUp
  49.   SetCursor free
  50.   SetCursor topleft of card field "Demo 2"
  51.   wait 180
  52.   SetCursor bottomright of card field "Demo 2"
  53.   wait 120
  54.   SetCursor reset
  55. end mouseUp
  56.  
  57.  
  58.  
  59. -- part 4 (button)
  60. -- low flags: 00
  61. -- high flags: 8003
  62. -- rect: left=402 top=271 right=293 bottom=502
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 0 / 0
  65. -- text alignment: 1
  66. -- font id: 0
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: Wander
  71. ----- HyperTalk script -----
  72. on mouseWithin
  73.   put the mouseH + random(3) - 2 into h
  74.   put the mouseV + random(3) - 2 into v
  75.   SetCursor h,v
  76. end mouseWithin
  77.  
  78.  
  79.  
  80. -- part 5 (button)
  81. -- low flags: 00
  82. -- high flags: 8003
  83. -- rect: left=402 top=299 right=321 bottom=503
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 1
  87. -- font id: 0
  88. -- text size: 12
  89. -- style flags: 0
  90. -- line height: 16
  91. -- part name: Bounce
  92. ----- HyperTalk script -----
  93. on mouseEnter
  94.   global hdelta, vdelta
  95.   put 1 into hdelta
  96.   put 1 into vdelta
  97. end mouseEnter
  98.  
  99. on mouseWithin
  100.   global hdelta, vdelta
  101.   put the mouseH into h
  102.   put the mouseV into v
  103.   if (hdelta = 1) and (h = right of me - 1) then put -1 into hdelta
  104.   else if (hdelta = -1) and (h = left of me)
  105.   then
  106.   put 1 into hdelta
  107. end if
  108. if (vdelta = 1) and (v = bottom of me - 1) then put -1 into vdelta
  109. else if (vdelta = -1) and (v = top of me)
  110. then
  111. put 1 into vdelta
  112. end if
  113. SetCursor h+hdelta,v+vdelta
  114. end mouseWithin
  115.  
  116.  
  117.  
  118. -- part 6 (button)
  119. -- low flags: 00
  120. -- high flags: 0001
  121. -- rect: left=6 top=299 right=328 bottom=37
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 1012 / 1012
  124. -- text alignment: 1
  125. -- font id: 0
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: New Button
  130. ----- HyperTalk script -----
  131. on mouseUp
  132.   visual effect iris close slow
  133.   go card 1
  134. end mouseUp
  135.  
  136.  
  137.  
  138. -- part 7 (field)
  139. -- low flags: 01
  140. -- high flags: 0004
  141. -- rect: left=108 top=41 right=93 bottom=508
  142. -- title width / last selected line: 0
  143. -- icon id / first selected line: 0 / 0
  144. -- text alignment: 0
  145. -- font id: 3
  146. -- text size: 12
  147. -- style flags: 0
  148. -- line height: 16
  149. -- part name: Move
  150.  
  151.  
  152. -- part 8 (field)
  153. -- low flags: 01
  154. -- high flags: 0004
  155. -- rect: left=108 top=98 right=265 bottom=509
  156. -- title width / last selected line: 0
  157. -- icon id / first selected line: 0 / 0
  158. -- text alignment: 0
  159. -- font id: 3
  160. -- text size: 12
  161. -- style flags: 0
  162. -- line height: 16
  163. -- part name: Demo 2
  164.  
  165.  
  166. -- part 9 (field)
  167. -- low flags: 01
  168. -- high flags: 0004
  169. -- rect: left=108 top=270 right=307 bottom=396
  170. -- title width / last selected line: 0
  171. -- icon id / first selected line: 0 / 0
  172. -- text alignment: 0
  173. -- font id: 3
  174. -- text size: 12
  175. -- style flags: 0
  176. -- line height: 16
  177. -- part name: 
  178.  
  179.  
  180. -- part contents for card part 7
  181. ----- text -----
  182. If you push the button to the left, the cursor will jump to the next demoΓǪ
  183. It does this by issuing: SetCursor loc of button "Demo 2"
  184.  
  185. -- part contents for card part 8
  186. ----- text -----
  187. On pushing the button to the left the cursor is freed from the mouse and jumps to the top left corner of this field ΓÇö try moving the mouseΓǪ After a few seconds the cursor will jump to the bottom right of this field, pause again and then return back to the button by issuing a "SetCursor reset".
  188. WARNING: If you abort the button script by typing "Command-." your cursor and mouse will be decoupled! To avoid embarrassment to those of you who are bound to try it, the closeCard handler issues a "SetCursor mouse"
  189. (which does nothing if they are coupled).
  190.  
  191. -- part contents for card part 9
  192. ----- text -----
  193. If you're not yet bored, try leaving the mouse over one of the buttons on the rightΓǪ